<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="EnrollEditDlg" widgetVar="EnrollEditDialog" modal="true" resizable="false" appendTo="@(body)" header="#{bundle.EditEnrollTitle}">
            <h:form id="EnrollEditForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{enrollController.selected != null}">
                        <p:outputLabel value="#{bundle.EditEnrollLabel_id}" for="id" />
                        <p:inputText id="id" value="#{enrollController.selected.id}" title="#{bundle.EditEnrollTitle_id}" required="true" requiredMessage="#{bundle.EditEnrollRequiredMessage_id}"/>
                        <p:outputLabel value="#{bundle.EditEnrollLabel_status}" for="status" />
                        <p:inputText id="status" value="#{enrollController.selected.status}" title="#{bundle.EditEnrollTitle_status}" />
                        <p:outputLabel value="#{bundle.EditEnrollLabel_reason}" for="reason" />
                        <p:inputText id="reason" value="#{enrollController.selected.reason}" title="#{bundle.EditEnrollTitle_reason}" />
                        <p:outputLabel value="#{bundle.EditEnrollLabel_introduction}" for="introduction" />
                        <p:inputText id="introduction" value="#{enrollController.selected.introduction}" title="#{bundle.EditEnrollTitle_introduction}" />
                        <p:outputLabel value="#{bundle.EditEnrollLabel_createdDate}" for="createdDate" />
                        <p:calendar id="createdDate" pattern="MM/dd/yyyy HH:mm:ss" value="#{enrollController.selected.createdDate}" title="#{bundle.EditEnrollTitle_createdDate}"  showOn="button"/>
                        <p:outputLabel value="#{bundle.EditEnrollLabel_paymentOption}" for="paymentOption" />
                        <p:inputText id="paymentOption" value="#{enrollController.selected.paymentOption}" title="#{bundle.EditEnrollTitle_paymentOption}" />
                        <p:outputLabel value="#{bundle.EditEnrollLabel_presentationFile}" for="presentationFile" />
                        <p:inputText id="presentationFile" value="#{enrollController.selected.presentationFile}" title="#{bundle.EditEnrollTitle_presentationFile}" />
                        <p:outputLabel value="#{bundle.EditEnrollLabel_accountId}" for="accountId" />
                        <p:selectOneMenu id="accountId" value="#{enrollController.selected.accountId}" >
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{accountController.itemsAvailableSelectOne}"
                                           var="accountIdItem"
                                           itemValue="#{accountIdItem}"/>
                        </p:selectOneMenu>
                        <p:outputLabel value="#{bundle.EditEnrollLabel_eventId}" for="eventId" />
                        <p:selectOneMenu id="eventId" value="#{enrollController.selected.eventId}" >
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{eventController.itemsAvailableSelectOne}"
                                           var="eventIdItem"
                                           itemValue="#{eventIdItem}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{enrollController.update}" value="#{bundle.Save}" update="display,:EnrollListForm:datalist,:growl" oncomplete="handleSubmit(args, 'EnrollEditDialog');"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="EnrollEditDialog.hide()"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
